package ru.housewife.form;

import ru.housewife.cache.CacheManager;
import ru.housewife.model.PreferableWareForComponent;

/**
 * Form object for
 * @see ru.housewife.model.PreferableWareForComponent
 * Date: 28.08.11 15:23
 *
 * @author Alexander Troshanin
 */
public class PreferableWareForComponentForm {

    private long id;

    private long componentId;

    private UserForm user;

    private WareForm ware;

    public PreferableWareForComponentForm() {
    }

    public PreferableWareForComponentForm(UserForm user, PreferableWareForComponent preferableWareForComponent) {
        this.id = preferableWareForComponent.getId();
        this.componentId = preferableWareForComponent.getComponentId();
        this.user = user;
        this.ware = CacheManager.getInstance().getWareForm(preferableWareForComponent.getWareId());
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getComponentId() {
        return componentId;
    }

    public void setComponentId(long componentId) {
        this.componentId = componentId;
    }

    public UserForm getUser() {
        return user;
    }

    public void setUser(UserForm user) {
        this.user = user;
    }

    public WareForm getWare() {
        return ware;
    }

    public void setWare(WareForm ware) {
        this.ware = ware;
    }
}
